package com.wtwd.device.controller;


import com.wtwd.device.model.entity.Frequency;
import com.wtwd.device.model.vo.ResultVO;
import com.wtwd.device.service.AppIFrequencyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author mjy
 * @since 2024-05-21
 */
@Api(tags = "频率模块")
@RestController
@RequestMapping("/frequency")
public class AppFrequencyController {

    @Resource
    private AppIFrequencyService appIFrequencyService;

    @ApiOperation("根据imei号频率类型查询频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "imei", value = "imei", required = true, dataType = "String"),
            @ApiImplicitParam(name = "type", value = "1.心率,2.血氧,3.血压,4.情绪检测", required = true, dataType = "int"),
    })
    @GetMapping("/queryFrequencyByImeiAndType")
    public ResultVO<Frequency> queryFrequencyByImeiAndType(@RequestParam String imei, @RequestParam Integer type) {
        Frequency data = appIFrequencyService.queryFrequencyByImeiAndType(imei, type);
        return ResultVO.success(data);
    }

}

